#define _CRT_SECURE_NO_WARNINGS 1
#include "Sort.h"

void TestQuickSort()
{
	int a[] = {6,1,2,7,9,3,4 ,5,10,8};
	Print(a, sizeof(a) / sizeof(a[0]));

	//QuickSort(a, 0, sizeof(a) / sizeof(a[0]) - 1);
	//QuickSortNonRByStack(a, 0, sizeof(a) / sizeof(a[0]) - 1);

	QuickSortNonRByQueue(a, 0, sizeof(a) / sizeof(a[0]) - 1);

	Print(a, sizeof(a) / sizeof(a[0]));

}


void TestMergeSort()
{
	int a[] = {6,1,2,7,9,3,4 ,5,10,8};

	Print(a, sizeof(a) / sizeof(a[0]));

	MergeSort(a,sizeof(a) / sizeof(a[0]));

	Print(a, sizeof(a) / sizeof(a[0]));
}


void TestMergeSortNonR()
{
	int a[] = {10,6,7,1,3,9,4,2,5,8};

	Print(a, sizeof(a) / sizeof(a[0]));

	MergeSortNonR(a,sizeof(a) / sizeof(a[0]));

	Print(a, sizeof(a) / sizeof(a[0]));

}


void TestCountSort()
{
	int a[] = {10,6,7,1,3,9,4,2,5,8,-1,-2};

	Print(a, sizeof(a) / sizeof(a[0]));

	CountSort(a,sizeof(a) / sizeof(a[0]));

	Print(a, sizeof(a) / sizeof(a[0]));

}

int main()
{
	//int a[] = { 9,8,7,6,5,4,3,2,1 };
	//int a[] = { 9,1,7,6,5,4,3,2,8 };
	//int a[] = {3,4,7,23,7,5,0 };

	//BubbleSort(a, sizeof(a) / sizeof(a[0]));
	//InsertSort(a, sizeof(a) / sizeof(a[0]));
	//ShellSort(a, sizeof(a) / sizeof(a[0]));
	//OldSelectSort(a, sizeof(a) / sizeof(a[0]));
	//OptimizeSelectSort(a, sizeof(a) / sizeof(a[0]));
	//HeapSort(a, sizeof(a) / sizeof(a[0]));

	//TestQuickSort();
	//TestMergeSort();
	//TestMergeSortNonR();
	TestCountSort();
	return 0;
}